Skip to content

refactor(blender): stabilize naming synchronization and decouple translator architecture#242

Merged
arounamounchili merged 13 commits into
mainfrom
feat/blender-core-alignment
May 12, 2026
Merged

refactor(blender): stabilize naming synchronization and decouple translator architecture#242
arounamounchili merged 13 commits into
mainfrom
feat/blender-core-alignment

Conversation

@arounamounchili

@arounamounchili arounamounchili commented May 11, 2026

Copy link
Copy Markdown
Owner

📝 Description

This PR stabilizes the LinkForge Blender platform by implementing a robust asynchronous naming synchronization system and refactoring the scene translation logic into a decoupled, registry-based architecture.

🛠️ Type of change

  • 🧪 Tests (test)
  • 🧹 Refactor (refactor)

✅ Checklist

  • I have run uv run pytest and all tests pass
  • I have run uv run pre-commit run --all-files and all hooks pass
  • I have verified the changes manually in the Blender viewport
  • I have updated the documentation or verified no changes are needed

…itecture

- Implemented two-tier deferred renaming (timers for GUI, queue for background).
- Decoupled platform adapters into a registry-based Translator pattern.
- Resolved asynchronous naming inconsistencies and race conditions in CI/CD.
- Professionalized error handling and type safety across blender platform.
- Maintained 100% test pass rate across 170+ unit and integration tests.

Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
@arounamounchili arounamounchili changed the title refactor(blender): stabilize naming sync and decouple translator architecture refactor(blender): stabilize naming synchronization and decouple translator architecture May 11, 2026
- Fix NoneType errors in view_layer access during headless tests\n- Stabilize MockCollection (hashability) and MockTimers (re-scheduling) for async operators\n- Cleanup temporary debug prints and optimize imports across the Blender platform\n- Resolve linting issues (duplicated keys, shadowed builtins, contextlib.suppress)

Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
…tion

- Centralize mock_bpy_env.py to tests/ root for unified mocking.
- Implement high-fidelity operator mocks (add_empty_link) to ensure scene population.
- Fix NoneType errors in physics, sensors, and converter robustness tests.
- Remove temporary debug prints and standardize defensive assertions.
- Ensure 100% test pass rate in both headless and real Blender environments.

Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
…ffness/damping

Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
…perties architecture

- Merged SimulationProperties into LinkPhysics core model.\n- Centralized physics constants (kp, kd, mu) in linkforge_core.constants.\n- Optimized dict_utils with Type Overloads for better Blender/Core compatibility.\n- Expanded safety net with new unit tests for all refactored logic.\n- Cleaned up dead code and stale TYPE_CHECKING blocks.

Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
- Merged redundant simulation properties into LinkPhysics dataclass.
- Implemented scientific notation proxies for kp/kd in Blender UI.
- Fixed type-inference issues in test suite for XACRO/URDF parsers.
- Added full round-trip tests for physics properties in Blender adapters.
- Renamed LinkBuilder.simulation to physics for architectural alignment.
- Sanitized codebase by removing dead code and unused imports.

Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
…e integration tests

- Implemented a Registry-based Translator pattern (ITranslator) for specialized component handling.
- Decoupled physical, mechanical, and control layers into dedicated Translators (Link, Joint, Sensor, Transmission, Ros2Control).
- Purged legacy shims, diagnostic prints, and dead code from the adapter layer.
- Fixed a critical 'MagicMock' leakage issue in integration tests by correcting property access in Ros2ControlTranslator.
- Standardized ROS 2 control property mapping to use 'hardware_plugin' per the core model specification.
- Achieved 100% test coverage for the new architecture with 58 unit tests and 16 integration tests.
- Sanitized imports and applied professional formatting across the adapter and test suites.

Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
- centralize physics safety limits in constants.py
- synchronize XML parsing with high-performance float bounds
- implement conditional Gazebo tag generation in URDFGenerator
- refactor Blender-to-Core translation for smarter Gazebo plugin handling
- ensure Gazebo ROS2 Control plugin is only generated when joints are present
- fix integration test regressions with robust mesh data extraction
- improve RobotValidationError reporting in Blender adapter

Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
…logic

- enforce STL format for collision meshes regardless of global preferences to ensure simulator compatibility
- implement smart "Advanced Simulation" toggle in importer: only enable if physics are modified or plugins exist
- restore missing physics fields (mu2, self_collide, gravity) during Core-to-Blender import
- fix logic error in Gazebo plugin generation by referencing active hardware interfaces
- verify all changes with a comprehensive unit and integration test suite
- ensure professional code quality with Ruff formatting and MyPy type checking

Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
…nd frozen dataclasses

- Converted Transmission and Ros2Control models to frozen dataclasses
- Enforced internal tuple storage for all core collections (links, joints, interfaces)
- Added update_ros2_control method to Robot model for professional state management
- Updated LinkBuilder to use functional replaces instead of illegal mutations
- Standardized on Sequence type hints and collections.abc imports
- Cleaned up dead legacy code (HardwareInterface enum)
- Updated test suite for strict structural compliance

Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
- Refactor _finalize_xml in xacro_parser.py to use namespace-aware filtering
- Centralize XACRO URIs and prefixes in constants.py
- Implement defensive assertions in test_xacro.py to prevent NoneType errors
- Fix Sequence concatenation type errors in robot and generator tests
- Clean up xml_utils.py namespace registration
- Verified with 805 tests, ruff, and mypy

Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
- Update urdf_parser.py and srdf_parser.py to import XACRO_URIS from constants
- Fix mypy 'attr-defined' errors after centralizing constants

Signed-off-by: arounamounchili <patouossa.mounchili@gmail.com>
@arounamounchili arounamounchili merged commit ebbcac9 into main May 12, 2026
13 checks passed
@arounamounchili arounamounchili deleted the feat/blender-core-alignment branch May 12, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant